import Vue from "vue";
import VueRouter from "vue-router";

import Login from '../views/login/appIndex.vue';
import Register from '../views/register/appIndex.vue';
import Home from '@/views/home/Home.vue';

const Product = ()=>import('@/views/product/AppIndex.vue')
const List = ()=>import('@/views/product/list/appIndex.vue')
const Goubi = ()=>import('@/views/product/goubi/AppIndex.vue')

const Order = ()=>import('@/views/order/Index.vue')
const Collect = ()=>import('@/views/order/collect/Index.vue')
const Listb = ()=>import('@/views/order/list/Index.vue')

const Advert = ()=>import('@/views/advert/Index.vue')
const Lista = ()=>import('@/views/advert/list/Index.vue')
Vue.use(VueRouter)


const router = new VueRouter({
    routes: [
        {
        path:'/',
        component:Register,
        children:[
            {
                path:'/',
                name:'home',
                component:Home,
            },
            {
                path:'/product',
                name:'product',
                component:Product,
                children:[
                    {
                        path:'list',
                        name:'list',
                        component:List,
                    },
                    {
                        path:'goubi',
                        name:'goubi',
                        component:Goubi,
                    },

                ]
            },
            {
                path:'/order',
                name:'order',
                component:Order,
                children:[
                    {
                        path:'collect',
                        name:'collect',
                        component:Collect,
                    },
                    {
                        path:'listb',
                        name:'listb',
                        component:Listb,
                    },

                ]
            },
            {
                path:'/advert',
                name:'advert',
                component:Advert,
                children:[
                    {
                        path:'lista',
                        name:'lista',
                        component:Lista,
                    },

                ]
            }
        ]
        },{
            path:'/login',
            component:Login,
        }

    ],
})

export default router